<?php

namespace App\Module\Api\Controllers;
use App\Module\Api\Controllers\Request\FinanceRecordListWhereRequest;
use App\Module\Api\Validator\FinanceRecordListValidator;
use App\System\Base\Services\TokenService;
use App\System\Fina\Repositories\FinaIntegralRegRecordRepository;

/**
 * 用户积分注册币列表
 */
class FinanceRecordListController extends Controller
{
    public function __construct()
    {
        $this->where = new FinanceRecordListWhereRequest();
        parent::__construct();

    }

    public function index()
    {
        (new FinanceRecordListValidator())->check();
        $user_id = TokenService::getUserId();
        $action = $this->query->action;
        $user = FinaIntegralRegRecordRepository::getInstance();
        $data = $user->getApiList($this->table,$this->where,$action,$user_id);
        return apiResponse($data);
    }
}
